package com.tx.blog.index.controller;

import com.tx.blog.user.vo.UserVo;
import com.tx.blog.util.HttpUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;


/**
 * @author ：tx
 * @description：
 * @date ：Created in 2019/4/25 14:20
 * @modified By：
 * @version:
 */
@Controller
public class IndexController {

    @RequestMapping("/index")
    public ModelAndView index(HttpServletRequest request){
        ModelAndView mv = new ModelAndView("index");
        UserVo userVo =  HttpUtil.getCurrentUser(request);
        mv.addObject("user",userVo);
        return mv;
    }

}
